Generate letter from information defined in form

<#> 
<#> Sample: Start Notepad and generate cutomer's letter based on
<#> what is selected in form.
<#> 
<cmds>

<#> Initialize and show form:

<form_item>("f1","Customer name:","EDIT","","vCustomerName")
<form_item>("f1","Service:","LIST","UNIX Virtual Server|NT Virtual Server|UNIX Dedicated Server|NT Dedicated Server","vService")
<form_item>("f1","Discount (in %):","LIST","0|5|10|20|30|50","vDiscount")
<form_item>("f1","Support staff:","LIST","John McSmith|Adrian Mane|Brigita Largo","vStaff")
<form_show>("f1","Customer Requests Information About Service","shell32.dll",0)
<if_str>("_vCanceled == 1") <exitmacro> <endif>

<#> Start Notepad and make it active window
<execappex>("notepad.exe","","",0,0)
<waitfor>("WIN","OPEN","mw[[  ]] mc[[ Notepad ]] cw[[  ]] cc[[  ]] ",5,0)
<actwin>("mw[[  ]] mc[[ Notepad ]] cw[[  ]] cc[[  ]] ",0,0,"no")
<if_win>("mw[[  ]] mc[[ Notepad ]] cw[[  ]] cc[[  ]] ","ACT",0)

<if_str>("vService==UNIX Virtual Server")
   <varset>("vPrice=99.95","")
<endif>
<if_str>("vService==NT Virtual Server")
   <varset>("vPrice=79.95","")
<endif>
<if_str>("vService==UNIX Dedicated Server")
   <varset>("vPrice=299.95","")
<endif>
<if_str>("vService==NT Dedicated Server")
   <varset>("vPrice=259.95","")
<endif>

<var_oper>(vDiscountedPrice,"%vPrice%-(%vPrice%*(%vDiscount%/100))",CALC_EXPRESSION,"2","", "0")

<#> Start writing letter here:
<keys>Dear <varout>("vCustomerName",0),

thank you very much for contacting us concerning our
web hosting services.  Find below some facts about
the service you are interested in.  We are glad we can 
offer you discounted price!

-------------------------------------------------------
Customer: <varout>("vCustomerName",0)
Service: <varout>("vService",0)
Bandwith: Unlimited
Price: <varout>("vPrice",0)/month
Discount: <varout>("vDiscount",0)%
Price after discount:<varout>("vDiscountedPrice",0)/month
-------------------------------------------------------

Feel free to contact us with any question any time.


<varout>("vStaff",0)
The Service Company Support